var BrowserWindow = require("./index");
module.exports = function (UC, source, config, ArFor, cache, package) {
  var UserControl = UC;
  var browserwindow = null;
  if (config.Electron) {
    var electron = config.Electron;
    browserwindow = new BrowserWindow(electron.BrowserWindow,electron);
    electron.onPrinter=function(PrinterDB){
      browserwindow.onPrinter(PrinterDB)
    };
    electron.Close.add(browserwindow.close)
  }
  var router = function () {
    var off = false;
    this.start = function () {
      off = true;
    };
    this.stop = function () {
      off = false;
    }
    this.name = "Printer";
    this.Printing = function (PrinterDB, Callback) {
      if (browserwindow) {
        browserwindow.onPrinter(PrinterDB, Callback)
      }
    }
  }
  return new router();
}